﻿package  {
	import flash.display.Sprite;

	public class ScatterPlot extends LineChart{
		public function ScatterPlot()
		{
			super();
		}
		
		public override function Init(sw:Number, sh:Number)
		{
			stageWidth = sw;
			stageHeight = sh;
			
			var spread:Number = stageWidth / dataPoints.length;
			var currentSpread:Number = 0;
			
			graphics.clear();
			graphics.lineStyle(1, colorArray[0]);
			graphics.beginFill(colorArray[0], 0.7);
			var yScale:Number = ScaleY(-1);

			for(var i:int = 0; i < dataPoints.length; i++)
			{
				yScale = ScaleY(dataPoints[i]);
				graphics.drawCircle(currentSpread,yScale,1);
				currentSpread += spread;
			}
			graphics.endFill();
		}
	}
}